package com.tinglv.imguider.api.web;

import com.alibaba.dubbo.config.annotation.Reference;
import com.tinglv.imguider.entity.Admin;
import com.tinglv.imguider.service.AdminService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 管理员API管理
 *
 * @author hochen
 * @date 2017/11/27 0027.
 */
@RestController @RequestMapping("/admin") public class AdminController {

    @Reference private AdminService adminService;

    /**
     * 条件查询
     *
     * @return
     * @throws Exception
     */
    @GetMapping("/hi") public String hello() throws Exception {
        return "hello world！";
    }

    /**
     * 条件查询
     *
     * @return
     * @throws Exception
     */
    @GetMapping("/one") public Admin listByType(String name) throws Exception {
        return adminService.findByName(name);
    }

}
